import service from '../../http';
import { RetVO, TotalBaseInfo } from '@/http/public.type.ts';
import { LoginDTO, RegisterDTO, TokenItem } from '@/pages/login/login.types.ts';

export function _login(param: LoginDTO): Promise<RetVO<TokenItem>> {
  return service.post('/api/v1.0/user/login', param);
}

export function _register(param: RegisterDTO): Promise<RetVO<any>> {
  return service.post('/api/v1.0/user/register', param);
}

export function _totalBaseInfo(): Promise<RetVO<TotalBaseInfo>> {
  return service.get('/api/v1.0/public/totalBaseInfo');
}

export function _logout(): Promise<RetVO<any>> {
  return service.post('/api/v1.0/user/logout');
}
